<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-unix;$(NetCoreAppCurrent)-browser;$(NetCoreAppCurrent)</TargetFrameworks>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
    <UseCompilerGeneratedDocXmlFile>false</UseCompilerGeneratedDocXmlFile>
  </PropertyGroup>

  <!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
  <PropertyGroup>
    <TargetPlatformIdentifier>$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))</TargetPlatformIdentifier>
    <GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetPlatformIdentifier)' == ''">SR.PlatformNotSupported_MemoryMappedFiles</GeneratePlatformNotSupportedAssemblyMessage>
  </PropertyGroup>

  <ItemGroup Condition="'$(TargetPlatformIdentifier)' != ''">
    <Compile Include="Microsoft\Win32\SafeMemoryMappedFileHandle.cs" />
    <Compile Include="Microsoft\Win32\SafeMemoryMappedViewHandle.cs" />
    <Compile Include="System\IO\MemoryMappedFiles\MemoryMappedFileOptions.cs" />
    <Compile Include="System\IO\MemoryMappedFiles\MemoryMappedFileAccess.cs" />
    <Compile Include="System\IO\MemoryMappedFiles\MemoryMappedFile.cs" />
    <Compile Include="System\IO\MemoryMappedFiles\MemoryMappedView.cs" />
    <Compile Include="System\IO\MemoryMappedFiles\MemoryMappedViewAccessor.cs" />
    <Compile Include="System\IO\MemoryMappedFiles\MemoryMappedViewStream.cs" />
    <Compile Include="System\IO\MemoryMappedFiles\MemoryMappedFileRights.cs" />
    <Compile Include="$(CommonPath)DisableRuntimeMarshalling.cs"
             Link="Common\DisableRuntimeMarshalling.cs" />
  </ItemGroup>

  <ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'windows'">
    <Compile Include="System\IO\MemoryMappedFiles\Interop.Windows.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.CreateFileMapping.cs"
             Link="Common\Interop\Windows\Interop.CreateFileMapping.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.MapViewOfFile.cs"
             Link="Common\Interop\Windows\Interop.MapViewOfFile.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.OpenFileMapping.cs"
             Link="Common\Interop\Windows\Interop.OpenFileMapping.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.VirtualAlloc.cs"
             Link="Common\Interop\Windows\Interop.VirtualAlloc.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.GlobalMemoryStatusEx.cs"
             Link="Common\Interop\Windows\Interop.GlobalMemoryStatusEx.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.SECURITY_ATTRIBUTES.cs"
             Link="Common\Interop\Windows\Interop.SECURITY_ATTRIBUTES.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Interop.Libraries.cs"
             Link="Common\Interop\Windows\Interop.Libraries.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.CloseHandle.cs"
             Link="Common\Interop\Windows\Interop.CloseHandle.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Interop.Errors.cs"
             Link="Common\Interop\Windows\Interop.Errors.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.FormatMessage.cs"
             Link="Common\Interop\Windows\Interop.FormatMessage.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.FileAttributes.cs"
             Link="Common\Interop\Windows\Interop.FileAttributes.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.FileOperations.cs"
             Link="Common\Interop\Windows\Interop.FileOperations.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.FlushViewOfFile.cs"
             Link="Common\Interop\Windows\Interop.FlushViewOfFile.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.GenericOperations.cs"
             Link="Common\Interop\Windows\Interop.GenericOperations.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.GetSystemInfo.cs"
             Link="Common\Interop\Windows\Interop.GetSystemInfo.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.SYSTEM_INFO.cs"
             Link="Common\Interop\Windows\Interop.SYSTEM_INFO.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.HandleOptions.cs"
             Link="Common\Interop\Windows\Interop.HandleOptions.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.MEMORY_BASIC_INFO.cs"
             Link="Common\Interop\Windows\Interop.MEMORY_BASIC_INFO.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.MEMORYSTATUSEX.cs"
             Link="Common\Interop\Windows\Interop.MEMORYSTATUSEX.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.MemOptions.cs"
             Link="Common\Interop\Windows\Interop.MemOptions.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.PipeOptions.cs"
             Link="Common\Interop\Windows\Interop.PipeOptions.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Interop.BOOL.cs"
             Link="Common\Interop\Windows\Interop.BOOL.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.SecurityOptions.cs"
             Link="Common\Interop\Windows\Interop.SecurityOptions.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.UnmapViewOfFile.cs"
             Link="Common\Interop\Windows\Interop.UnmapViewOfFile.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.VirtualQuery.cs"
             Link="Common\Interop\Windows\Interop.VirtualQuery.cs" />
    <Compile Include="$(CommonPath)System\IO\Win32Marshal.cs"
             Link="Common\System\IO\Win32Marshal.cs" />
    <Compile Include="Microsoft\Win32\SafeMemoryMappedFileHandle.Windows.cs" />
    <Compile Include="Microsoft\Win32\SafeMemoryMappedViewHandle.Windows.cs" />
    <Compile Include="System\IO\MemoryMappedFiles\MemoryMappedFile.Windows.cs" />
    <Compile Include="System\IO\MemoryMappedFiles\MemoryMappedView.Windows.cs" />
  </ItemGroup>

  <ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'unix' or '$(TargetPlatformIdentifier)' == 'browser' ">
    <Compile Include="$(CommonPath)Interop\Unix\Interop.Libraries.cs"
             Link="Common\Interop\Unix\Interop.Libraries.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\Interop.Errors.cs"
             Link="Common\Interop\Unix\Interop.Errors.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.Fcntl.cs"
             Link="Common\Interop\Unix\Interop.Fcntl.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\Interop.IOErrors.cs"
             Link="Common\Interop\Unix\Interop.IOErrors.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.MMap.cs"
             Link="Common\Interop\Unix\Interop.MMap.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.MUnmap.cs"
             Link="Common\Interop\Unix\Interop.MUnmap.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.MSync.cs"
             Link="Common\Interop\Unix\Interop.MSync.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.Open.cs"
             Link="Common\Interop\Unix\Interop.Open.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.OpenFlags.cs"
             Link="Common\Interop\Unix\Interop.OpenFlags.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.Stat.cs"
             Link="Common\Interop\Unix\Interop.Stat.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.SysConf.cs"
             Link="Common\Interop\Unix\Interop.SysConf.cs" />
    <Compile Include="Microsoft\Win32\SafeMemoryMappedFileHandle.Unix.cs" />
    <Compile Include="Microsoft\Win32\SafeMemoryMappedViewHandle.Unix.cs" />
    <Compile Include="System\IO\MemoryMappedFiles\MemoryMappedFile.Unix.cs" />
    <Compile Include="System\IO\MemoryMappedFiles\MemoryMappedView.Unix.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.FTruncate.cs"
             Link="Common\Interop\Unix\Interop.FTruncate.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.MAdvise.cs"
             Link="Common\Interop\Unix\Interop.MAdvise.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.ShmOpen.cs"
             Link="Common\Interop\Unix\Interop.ShmOpen.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.Unlink.cs"
             Link="Common\Interop\Unix\Interop.Unlink.cs" />
  </ItemGroup>

  <ItemGroup>
    <Reference Include="System.Memory" />
    <Reference Include="System.Runtime" />
    <Reference Include="System.Runtime.InteropServices" />
    <Reference Include="System.Threading" />
    <Reference Include="System.Threading.Thread" />
  </ItemGroup>

</Project>
